package com.icedevcloud.upms.controller.admin.permission.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * <p>
 * 添加权限ReqDto
 * </p>
 *
 * @author dengbing
 * @since 2023-08-13
 */
@Schema(description = "添加权限ReqDto")
@Data
public class AddPermissionReqDto {

    @Min(value = 0, message = "父ID不能为负数")
    @NotNull(message = "父ID不能为空")
    @Schema(description = "父ID")
    private Long pid;

    @Size(min = 3, max = 20, message = "菜单名称长度为3-20个字符")
    @NotBlank(message = "菜单名称不能为空")
    @Schema(description = "菜单名称")
    private String permName;

    @Size(max = 64, message = "权限编码长度不能超过20个字符")
    @Schema(description = "权限编码")
    private String permCode;

    @Schema(description = "路由地址")
    private String path;

    @Schema(description = "路由地址名称")
    private String pathName;

    @Schema(description = "组件路径")
    private String component;

    @Schema(description = "图标")
    private String icon;

    @NotNull(message = "排序号不能为空")
    @Schema(description = "排序号")
    private Integer sort;

    @Schema(description = "设为true后在左侧菜单不会显示该页面选项")
    private Integer hidden;

    @Schema(description = "设为true后页面缓存")
    private Integer cache;

    @NotBlank(message = "类型不能为空")
    @Schema(description = "类型（D目录 M菜单 B按钮）")
    private String permType;

    @NotNull(message = "状态不能为空")
    @Schema(description = "状态")
    private Integer status;

    @Size(max = 255, message = "备注长度不能超过255个字符")
    @Schema(description = "备注")
    private String remark;

}
